<?php
/*
 
 CREATE TABLE page (
	keywords varchar,
	description varchar,
	visible boolean not null default true,
	sorder integer not null default 0,
	PRIMARY KEY(id)
)  inherits (resource); 
  
 */

class Agitum_Orm_Page extends Agitum_Orm_Resource
{
    protected function init()
    {
        parent::init();
        
        $this->name = 'page';
        $this->title = 'Страница';
        
        $this->schema['keywords'] = Agitum_Orm_Attribute::factory(
            Agitum_Orm_Attirbute_Type::Text, 
            array(
                'name' => 'keywords',
                'title' => 'Ключевые слова',
                'sortOrder' => '100'
            )
        );
        
        $this->schema['keywords'] = Agitum_Orm_Attribute::factory(
            Agitum_Orm_Attirbute_Type::Text, 
            array(
                'name' => 'description',
                'title' => 'Описание',
                'sortOrder' => '110'
            )
        );
        
        $this->schema['visible'] = Agitum_Orm_Attribute::factory(
            Agitum_Orm_Attirbute_Type::Boolean, 
            array(
                'name' => 'visible',
                'title' => 'Видимость',
                'sortOrder' => '120'
            )
        );
        
        $this->schema['sorder'] = Agitum_Orm_Attribute::factory(
            Agitum_Orm_Attirbute_Type::Boolean, 
            array(
                'name' => 'sorder',
                'title' => 'Порядок сортировки',
                'sortOrder' => '130'
            )
        );
    }
}
